<?php

/**
 * Productos filter form.
 *
 * @package    tercermilenio
 * @subpackage filter
 * @author     Your name here
 */
class ProductosFormFilter extends BaseProductosFormFilter {

    public function configure() {

    }

    public function setup() {

        parent::setup();



        $this->setWidgets(array(
            'pro_articulo' => new sfWidgetFormFilterInput(array('with_empty' => false)),
            'pro_talle' => new sfWidgetFormFilterInput(array('with_empty' => false)),
            //'pro_precio' => new sfWidgetFormFilterInput(array('with_empty' => false)),
            //'pro_cantidad' => new sfWidgetFormFilterInput(array('with_empty' => false)),
            //'pro_ganancia' => new sfWidgetFormFilterInput(array('with_empty' => false)),
            'pro_descripcion' => new sfWidgetFormFilterInput(array('with_empty' => false)),
            'pro_marca' => new sfWidgetFormPropelChoice(array('model' => 'Marcas', 'add_empty' => 'Seleccione una marca')),
            'pro_rubro' => new sfWidgetFormPropelChoice(array('model' => 'Rubros', 'add_empty' => 'Seleccione un rubro')),
            'pro_proveedor' => new sfWidgetFormPropelChoice(array('model' => 'Proveedores', 'add_empty' => 'Seleccione un proveedor')),
            //'devoluciones_list' => new sfWidgetFormPropelChoice(array('model' => 'Ventas', 'add_empty' => true)),
            //'detalle_ventas_list' => new sfWidgetFormPropelChoice(array('model' => 'Ventas', 'add_empty' => true)),
            //'detalle_compras_list' => new sfWidgetFormPropelChoice(array('model' => 'Compras', 'add_empty' => true)),
        ));

        $this->setValidators(array(
            'pro_articulo' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
            'pro_talle' => new sfValidatorSchemaFilter('text', new sfValidatorString(array('required' => false))),
            //'pro_precio' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
            //'pro_cantidad' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
            //'pro_ganancia' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
            'pro_descripcion' => new sfValidatorPass(array('required' => false)),
            'pro_marca' => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Marcas', 'column' => 'mar_id')),
            'pro_rubro' => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Rubros', 'column' => 'rub_id')),
            'pro_proveedor' => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Proveedores', 'column' => 'pvd_id')),
            //'devoluciones_list' => new sfValidatorPropelChoice(array('model' => 'Ventas', 'required' => false)),
            //'detalle_ventas_list' => new sfValidatorPropelChoice(array('model' => 'Ventas', 'required' => false)),
            //'detalle_compras_list' => new sfValidatorPropelChoice(array('model' => 'Compras', 'required' => false)),
        ));

        $this->widgetSchema->setNameFormat('productos_filters[%s]');

        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
    }

}
